/*
 * <p>Title: :MetadataContainer.java </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2009</p>
 * <p>Company: Digitalchina Co.Ltd</p>
 * @author lijun
 * @version 1.0
 * 修改历史： 
 * <作者> <时间(yyyy/mm/dd)>  <修改内容>  <版本号>
 */
package com.dc.trans.steps.bwzh.metadata.impls;

import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
import java.util.Properties;

import com.dc.trans.steps.bwzh.metadata.interfaces.IMetadata;
import com.dc.trans.steps.bwzh.metadata.interfaces.IMetadataContainer;

public class MetadataContainer implements IMetadataContainer {

	private ArrayList list = new ArrayList();

	private Properties pro = new Properties();

	private IMetadataContainer parent;

	

	public IMetadataContainer getParent() {
		return this.parent;
	}

	public void setParent(IMetadataContainer parent) {
		this.parent = parent;
	}

	public String getName() {
		return this.name;
	}

	public String getProperty(String name) {
		return pro.getProperty(name);
	}

	public void setProperty(String name, String value) {
		pro.setProperty(name, value);
	}

	public void addChild(IMetadata metadata) {
		list.add(metadata);
	}

	public List getChild() {
		return this.list;
	}

	public int getChildSize() {
		// TODO 自动生成方法存根
		return 0;
	}
	
	private String lable = "";

	public String getDataLable() {
		return this.lable;
	}
    protected String name="";//特殊处理，以后可能需要改动，暂时为了mbsd展示界面
	public String[] getPropertyNames() {
		ArrayList array = new ArrayList();
		Enumeration keys = pro.keys();
		while (keys.hasMoreElements()) {
			array.add(keys.nextElement());
		}
		return (String[]) array.toArray((new String[array.size()]));
	}

	public void setDataLable(String lable) {
		this.lable = lable;
	}

}
